package com.dagao.controller;

import com.dagao.pojo.Stu;
import com.dagao.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("u")
public class HelloController {

    @Autowired
    private StuService stuService;

    @GetMapping
    public Object hello(){
        return "Hello UserService!";
    }


    @GetMapping("/save")
    public boolean save(){
        Stu stu=new Stu();
        stu.setAge(18);
        stu.setName("测试");
        stuService.save(stu);
        return false;
    }
}
